using System;
using System.Collections;

namespace HarrisDesigns.Controls.dasBlogControls
{
    public class DataStore<T>
    {
        public DateTime LastUpdate { get; private set; }
        public T Data { get; private set; }
        public bool IsDataMissing
        {
            get
            {
                if (Equals(Data, default(T)))
                    return true;
                var dataList = Data as ICollection;
                return dataList != null && dataList.Count == 0;
            }
        }
        public void UpdateData(T data)
        {
            Data = data;
            LastUpdate = DateTime.Now;
        }
    }
}